//
//  BuilderProtocol.swift
//  SFDevFly
//
//  Created by shen on 2023/9/28.
//

import Foundation

protocol BuilderProtocol {
    func isMatchLang(_ lang: LangType) -> Bool

    func propertyText(_ type: PropertyType, keyName: String, strategy: PropertyStrategy, maxKeyNameLength: Int, keyTypeName: String?) -> String
    func propertyInitText(_ type: PropertyType, keyName: String, strategy: PropertyStrategy, maxKeyNameLength: Int, keyTypeName: String?) -> String
    func propertyGetterText(_ type: PropertyType, keyName: String, strategy: PropertyStrategy, keyTypeName: String?) -> String
    func propertySetterText(_ type: PropertyType, keyName: String, strategy: PropertyStrategy, keyTypeName: String?) -> String

    func contentParentClassText(_ clsText: String?) -> String
    func contentText(_ structType: StructType, clsName: String, parentClsName: String, propertiesText: String, propertiesInitText: String?, propertiesGetterSetterText: String?) -> String
    func contentImplText(_ content: Content, strategy: PropertyStrategy, useKeyMapper: Bool) -> String

    func fileSuffix() -> String
    func fileImplSuffix() -> String
    func fileImportText(_ rootName: String, contents: [Content], strategy: PropertyStrategy, prefix: String?) -> String
    func fileExport(_ path: String, config: File, content: String, classImplContent: String?) -> [Export]

    func fileImplText(_ header: String, rootName: String, prefix: String?, contentCustomPropertyMapperTexts: [String]) -> String
}

extension BuilderProtocol {
    func propertyInitText(_ type: PropertyType, keyName: String, strategy: PropertyStrategy, maxKeyNameLength: Int, keyTypeName: String?) -> String {
        return ""
    }

    func propertyGetterText(_ type: PropertyType, keyName: String, strategy: PropertyStrategy, keyTypeName: String?) -> String {
        return ""
    }

    func propertySetterText(_ type: PropertyType, keyName: String, strategy: PropertyStrategy, keyTypeName: String?) -> String {
        return ""
    }

    func contentImplText(_ content: Content, strategy: PropertyStrategy, useKeyMapper: Bool) -> String {
        return ""
    }

    func fileImplSuffix() -> String {
        return ""
    }

    func fileImplText(_ header: String, rootName: String, prefix: String?, contentCustomPropertyMapperTexts: [String]) -> String {
        return ""
    }
}
